package com.example.jrfwcwgl.service.impl;

import com.example.jrfwcwgl.entity.PaymentPlan;
import com.example.jrfwcwgl.mapper.PaymentPlanMapper;
import com.example.jrfwcwgl.service.IPaymentPlanService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.org.dto.PaymentPlanDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 第三周付款计划 服务实现类
 * </p>
 *
 * @author example
 * @since 2021-11-23
 */
@Service
public class PaymentPlanServiceImpl extends ServiceImpl<PaymentPlanMapper, PaymentPlan> implements IPaymentPlanService {

    @Autowired
    PaymentPlanMapper paymentPlanMapper;

    @Override
    public PageInfo<PaymentPlan> getPaymentPlanList(PaymentPlanDto paymentPlanDto) {

        PageHelper.startPage(paymentPlanDto.getPageNum(),paymentPlanDto.getPageSize());

        List<PaymentPlan> paymentPlanList = paymentPlanMapper.getPaymentPlanList(paymentPlanDto);

        PageInfo<PaymentPlan> info = new PageInfo<>(paymentPlanList);
        return info;
    }
}
